import { MigrationInterface, QueryRunner } from 'typeorm';

export class Data1754118372979 implements MigrationInterface {
  public async up(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(
      "INSERT INTO `meetingRoom` (`id`, `name`, `capacity`, `location`, `equipment`, `description`, `isBooked`, `createTime`, `updateTime`) VALUES (1, '木星', 10, '一层西', '白板', '', 0, '2025-04-22 20:56:50.028314', '2025-04-22 20:56:50.028314');",
    );
    await queryRunner.query(
      "INSERT INTO `meetingRoom` (`id`, `name`, `capacity`, `location`, `equipment`, `description`, `isBooked`, `createTime`, `updateTime`) VALUES (2, '金星', 5, '二层东', '', '', 0, '2025-04-22 20:56:50.028314', '2025-04-22 20:56:50.028314');",
    );
    await queryRunner.query(
      "INSERT INTO `meetingRoom` (`id`, `name`, `capacity`, `location`, `equipment`, `description`, `isBooked`, `createTime`, `updateTime`) VALUES (3, '天王星', 30, '三层东', '白板，电视', '', 0, '2025-04-22 20:56:50.028314', '2025-04-22 20:56:50.028314');",
    );
    await queryRunner.query(
      "INSERT INTO `meetingRoom` (`id`, `name`, `capacity`, `location`, `equipment`, `description`, `isBooked`, `createTime`, `updateTime`) VALUES (4, '会议室1', 100, '右一', '设备一', '描述', 0, '2025-04-27 21:18:28.427604', '2025-04-27 21:18:28.427604');",
    );
    await queryRunner.query(
      "INSERT INTO `meetingRoom` (`id`, `name`, `capacity`, `location`, `equipment`, `description`, `isBooked`, `createTime`, `updateTime`) VALUES (5, '会议室2', 100, '右二', '设备二', '描述', 0, '2025-04-27 21:22:22.510145', '2025-04-27 21:22:22.510145');",
    );
    await queryRunner.query(
      "INSERT INTO `meetingRoom` (`id`, `name`, `capacity`, `location`, `equipment`, `description`, `isBooked`, `createTime`, `updateTime`) VALUES (6, '会议室3', 10, '右二', '设备二', '描述', 0, '2025-04-27 21:22:42.134707', '2025-04-27 21:47:25.000000');",
    );
    await queryRunner.query(
      "INSERT INTO `permissions` (`id`, `code`, `description`) VALUES (3, 'ccc', '访问ccc接口');",
    );
    await queryRunner.query(
      "INSERT INTO `permissions` (`id`, `code`, `description`) VALUES (4, 'ddd', '访问ddd接口');",
    );
    await queryRunner.query(
      "INSERT INTO `roles` (`id`, `name`) VALUES (3, '管理员');",
    );
    await queryRunner.query(
      "INSERT INTO `roles` (`id`, `name`) VALUES (4, '用户');",
    );
    await queryRunner.query(
      'INSERT INTO `role_permissions` (`rolesId`, `permissionsId`) VALUES (3, 3);',
    );
    await queryRunner.query(
      'INSERT INTO `role_permissions` (`rolesId`, `permissionsId`) VALUES (3, 4);',
    );
    await queryRunner.query(
      'INSERT INTO `role_permissions` (`rolesId`, `permissionsId`) VALUES (4, 3);',
    );

    await queryRunner.query(
      "INSERT INTO `users` (`id`, `username`, `password`, `nick_name`, `email`, `phoneNumber`, `isFrozen`, `isAdmin`, `createTime`, `updateTime`, `headPic`) VALUES (1, 'liubohang', 'e10adc3949ba59abbe56e057f20f883e', '大刘', 'xxx@xx.com', NULL, 1, 0, '2025-03-29 15:26:27.371523', '2025-04-20 14:24:53.000000', 'uploads/1745066336513-131433402-李盛兴标准.jpg');",
    );
    await queryRunner.query(
      "INSERT INTO `users` (`id`, `username`, `password`, `nick_name`, `email`, `phoneNumber`, `isFrozen`, `isAdmin`, `createTime`, `updateTime`, `headPic`) VALUES (4, 'zhangsan', '96e79218965eb72c92a549dd5a330112', '张三', 'xxx@xx.com', '13233323333', 0, 1, '2025-03-29 22:20:28.715928', '2025-04-20 16:48:28.000000', 'uploads/1745138905516-31395722-老白干企业家展架1.jpg');",
    );
    await queryRunner.query(
      "INSERT INTO `users` (`id`, `username`, `password`, `nick_name`, `email`, `phoneNumber`, `isFrozen`, `isAdmin`, `createTime`, `updateTime`, `headPic`) VALUES (5, 'lisi', 'e3ceb5881a0a1fdaad01296d7554868d', '李四', 'yy@yy.com', NULL, 0, 0, '2025-03-29 22:20:28.723930', '2025-03-29 22:20:28.723930', NULL);",
    );
    await queryRunner.query(
      "INSERT INTO `users` (`id`, `username`, `password`, `nick_name`, `email`, `phoneNumber`, `isFrozen`, `isAdmin`, `createTime`, `updateTime`, `headPic`) VALUES (6, 'liushenmeliu', '4297f44b13955235245b2497399d7a93', '大刘', 'lbh921117@163.com', NULL, 1, 0, '2025-04-15 21:40:33.569505', '2025-04-20 14:25:16.000000', 'uploads/1745066476866-410258280-李盛兴标准.jpg');",
    );
    await queryRunner.query(
      "INSERT INTO `users` (`id`, `username`, `password`, `nick_name`, `email`, `phoneNumber`, `isFrozen`, `isAdmin`, `createTime`, `updateTime`, `headPic`) VALUES (7, 'daliu', '123456', '大流', 'xxxxxx@xx.com', NULL, 0, 0, '2025-04-20 14:26:40.644305', '2025-04-20 14:26:40.644305', NULL);",
    );
    await queryRunner.query(
      "INSERT INTO `users` (`id`, `username`, `password`, `nick_name`, `email`, `phoneNumber`, `isFrozen`, `isAdmin`, `createTime`, `updateTime`, `headPic`) VALUES (8, 'xiaoliu', 'e10adc3949ba59abbe56e057f20f883e', '小刘', 'lbh921117@163.com', NULL, 0, 0, '2025-04-20 14:32:04.571700', '2025-04-20 14:32:04.571700', NULL);",
    );
    await queryRunner.query(
      "INSERT INTO `users` (`id`, `username`, `password`, `nick_name`, `email`, `phoneNumber`, `isFrozen`, `isAdmin`, `createTime`, `updateTime`, `headPic`) VALUES (9, 'xiaoxiaoliu', 'e10adc3949ba59abbe56e057f20f883e', '小小刘', 'lbh921117@163.com', NULL, 0, 0, '2025-04-20 14:32:38.942302', '2025-04-20 14:32:38.942302', NULL);",
    );
    await queryRunner.query(
      "INSERT INTO `users` (`id`, `username`, `password`, `nick_name`, `email`, `phoneNumber`, `isFrozen`, `isAdmin`, `createTime`, `updateTime`, `headPic`) VALUES (10, 'liuliu', 'e10adc3949ba59abbe56e057f20f883e', '刘刘', 'lbh921117@163.com', NULL, 0, 0, '2025-04-20 14:33:08.558701', '2025-04-20 14:33:08.558701', NULL);",
    );
    await queryRunner.query(
      "INSERT INTO `users` (`id`, `username`, `password`, `nick_name`, `email`, `phoneNumber`, `isFrozen`, `isAdmin`, `createTime`, `updateTime`, `headPic`) VALUES (11, 'xiaoli', 'e10adc3949ba59abbe56e057f20f883e', '小李', 'lbh921117@163.com', NULL, 0, 0, '2025-04-20 14:33:42.771099', '2025-04-20 14:33:42.771099', NULL);",
    );
    await queryRunner.query(
      'INSERT INTO `user_roles` (`usersId`, `rolesId`) VALUES (4, 3);',
    );
    await queryRunner.query(
      'INSERT INTO `user_roles` (`usersId`, `rolesId`) VALUES (5, 4);',
    );
  }

  public async down(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query('TRUNCATE TABLE booking');
  }
}
